package com.health.security.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.health.security.Admin;
import com.health.security.AdminMapper;
import com.health.security.AdminService;
import org.springframework.stereotype.Service;

/**
 * @author: zipeng Li
 * 2021/6/12  21:52
 */
@Service
public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin> implements AdminService {

    @Override
    public Admin getAdminByUserName(String username) {
        QueryWrapper<Admin> query = new QueryWrapper<>();
        query.lambda().eq(Admin::getUsername, username);
        return this.baseMapper.selectOne(query);
    }
}
